package cn.iocoder.yudao.module.erp.dal.mysql.dpeast;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.erp.controller.admin.dpitem.dpeastlistbj.vo.DpEastListBjPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.dplist.DpEastListBjDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.dplist.DpEastListGzDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 北疆口岸仓东线清单 Mapper
 * @author 天使管理员
 */
@Mapper
public interface DpEastListBjMapper extends BaseMapperX<DpEastListBjDO> {

    default PageResult<DpEastListBjDO> selectPage(DpEastListBjPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DpEastListBjDO>()
                .eqIfPresent(DpEastListBjDO::getNo, reqVO.getNo())
                .eqIfPresent(DpEastListBjDO::getTicketNo, reqVO.getTicketNo())
                .eqIfPresent(DpEastListBjDO::getBoxMarking, reqVO.getBoxMarking())
                .likeIfPresent(DpEastListBjDO::getProductName, reqVO.getProductName())
                .eqIfPresent(DpEastListBjDO::getProductInfo, reqVO.getProductInfo())
                .eqIfPresent(DpEastListBjDO::getMaterialRu, reqVO.getMaterialRu())
                .eqIfPresent(DpEastListBjDO::getQuantity, reqVO.getQuantity())
                .eqIfPresent(DpEastListBjDO::getQuantityPerBox, reqVO.getQuantityPerBox())
                .eqIfPresent(DpEastListBjDO::getUnit, reqVO.getUnit())
                .eqIfPresent(DpEastListBjDO::getTotal, reqVO.getTotal())
                .eqIfPresent(DpEastListBjDO::getLength, reqVO.getLength())
                .eqIfPresent(DpEastListBjDO::getWidth, reqVO.getWidth())
                .eqIfPresent(DpEastListBjDO::getHigh, reqVO.getHigh())
                .eqIfPresent(DpEastListBjDO::getVolumePerBox, reqVO.getVolumePerBox())
                .eqIfPresent(DpEastListBjDO::getCubem, reqVO.getCubem())
                .eqIfPresent(DpEastListBjDO::getGrossWeightPerBox, reqVO.getGrossWeightPerBox())
                .eqIfPresent(DpEastListBjDO::getGrossWeight, reqVO.getGrossWeight())
                .eqIfPresent(DpEastListBjDO::getNetWeightBox, reqVO.getNetWeightBox())
                .eqIfPresent(DpEastListBjDO::getTotalNetWeight, reqVO.getTotalNetWeight())
                .eqIfPresent(DpEastListBjDO::getPackaging, reqVO.getPackaging())
                .eqIfPresent(DpEastListBjDO::getNotes, reqVO.getNotes())
                .orderByDesc(DpEastListBjDO::getId));
    }

    default List<DpEastListBjDO> selectListByNo(String no) {
        return selectList(DpEastListBjDO::getNo, no);
    }

    default int deleteByNo(String no) {
        return delete(DpEastListBjDO::getNo, no);
    }

}